package com.dj.ms.configure;

import com.dj.ms.session.SessionCollector;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * <br>
 * <p>微服务切面配置项</p>
 *
 * <br>
 *
 * @author ZJG
 * @version 1.0
 * @date 2021/7/28 上午10:14
 */
@Slf4j
@Configuration
@Order(Ordered.HIGHEST_PRECEDENCE)
@ComponentScan(basePackages = "com.dj.ms.controller")
public class MicroServiceAopConfiguration {

    @Bean("sessionCollector")
    @ConditionalOnMissingBean(SessionCollector.class)
    public SessionCollector sessionCollector() {
        log.info("SessionCollector init.");
        return new SessionCollector();
    }
}
